# Maintainer: Frederik Schwan <freswa at archlinux dot org>
# Contributor: Mattias Andrée <`base64 -d`(bWFhbmRyZWUK)@kth.se>

pkgname=libkeccak
pkgver=1.4
pkgrel=1
pkgdesc='Keccak-family hashing library'
arch=('loong64' 'x86_64')
url='https://github.com/maandree/libkeccak'
license=('custom:ISC')
depends=('glibc')
source=("https://codeberg.org/maandree/libkeccak/archive/${pkgver}.tar.gz")
b2sums=('645ae0cb8bb8c8f512487eec876bc63bd8c2e2a5243e3ebe32aca2e4cc79a3271a18a8295d097f6a1e536444bcf1af6331507ccf814bab2ae838c005434ca84f')

prepare() {
  cd ${pkgname}
  sed -i 's#FLAGS\s\+=#FLAGS +=#g' optimised.mk
}

build() {
  cd ${pkgname}
  make CONFIGFILE=optimised.mk PREFIX=/usr
}

check() {
  cd ${pkgname}
  make CONFIGFILE=optimised.mk check
}

package() {
  cd ${pkgname}
  make CONFIGFILE=optimised.mk PREFIX=/usr DESTDIR="${pkgdir}" install
}
